package com.itheima.controller;

import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.JobOptionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/report")
public class JobOptionController {

    @Autowired
    private JobOptionService jobOptionService;


    /***
     * 统计性别人数
     * @return
     */
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        log.info("统计性别人数");
        List<Map> list = jobOptionService.getEmpGenderData();
        return Result.success(list);
    }


    /***
     * 查询统计员工职位人数
     * @return
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("查询统计员工职位人数");
        JobOption jobOption = jobOptionService.getEmpJobData();
        return Result.success(jobOption);
    }
}
